package com.wkhyapp.lm.contract;

import com.wkhyapp.lm.base.BasePresenter;
import com.wkhyapp.lm.http.ApiCallback;
import com.wkhyapp.lm.http.net.BaseRequest;
import com.wkhyapp.lm.http.net.SuperResponse;
import com.wkhyapp.lm.http.vo.Category;

/**
 * Created by Administrator on 2021-10-1.
 */

public class IndexPresenter extends BasePresenter<IndexView> {


    boolean flag = true;

    public IndexPresenter(IndexView indexView) {
        super(indexView);
    }


    public void getCategory(){

        BaseRequest request = new BaseRequest();
        addSubscription(apiStores.getCategory(request),new ApiCallback<SuperResponse<Category>>() {
            @Override
            public void onSuccess(SuperResponse<Category> response) {
                mvpView.setCategory(response.getItems());
            }
            @Override
            public void onFailure(String msg) {
//                mvpView.setfail("");
            }

            @Override
            public void onFinish() {
                mvpView.dismissLoad();
            }
        });
    }




}
